﻿<local:DocumentBase x:Class="WPFExcelReport.ABINFON"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                      
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="后整状态"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
     >
    <local:DocumentBase.Resources>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource x:Key="wASTAMMViewSource" Source="{Binding Path=WASTAMM, Source={StaticResource iNTEXDataSet}}" />
        <CollectionViewSource x:Key="aBPOSViewSource" Source="{Binding Path=ABPOS, Source={StaticResource iNTEXDataSet}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" HorizontalAlignment="Left" Margin="0,0,0,0" Name="btnQuery"
                            VerticalAlignment="Center" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表"  Height="23" HorizontalAlignment="Left" Margin="0,0,0,0" Name="btnReport"
                            VerticalAlignment="Top" Width="75"
                                Click="btnReport_Click" 
                                />
            <Button Content="打印报表" Height="23" Margin="0,0,0,0"  Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <Button Content="浏览数据" Height="23" Margin="0,0,0,0"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click"/>
        </WrapPanel>
        <StackPanel Grid.Row="1" Name="MainPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Expander Header="查询条件" Name="zoneQueryCond"  IsExpanded="True" ExpandDirection="Up"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="1" >
                        <WrapPanel>
                            <Label Content="品种:"  Width="52"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtArticle" Text="" Width="100"  HorizontalAlignment="Left" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                            <Label Content="客户:"  Width="52"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtCustomer" Text="" Width="100"  HorizontalAlignment="Left" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                        </WrapPanel>
                        <WrapPanel>
                            <Label Content="交期"  FontSize="18" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label1" 
                       VerticalAlignment="Top" Width="45"  />
                            <TextBox Name="gsendstartdate"  Height="30"  Width="90" HorizontalAlignment="Left" Background="Azure" GotFocus="Date_GotFocus" FontSize="16" MaxLength="8" Panel.ZIndex="4" />
                            <DatePicker Grid.Column="1" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="gsendstartDateChooser" VerticalAlignment="Top" Width="100" 
                                SelectedDateChanged="gsendstartDateChooser_SelectedDateChanged"/>
                            <Label  Content="至"  FontSize="18" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label2" VerticalAlignment="Top" Width="29" />
                            <TextBlock Name="gsendenddate" Height="30"  Width="100" GotFocus="Date_GotFocus" Background="Azure" FontSize="16" Text="" />
                            <DatePicker Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="gsendendDateChooser" VerticalAlignment="Top" Width="100" 
                                SelectedDateChanged="gsendendDateChooser_SelectedDateChanged"/>
                            <Label  Content="开单日期"  FontSize="18" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label3" VerticalAlignment="Top" Width="84" />
                            <TextBlock Name="openorderdate" Height="30"  Width="100" GotFocus="Date_GotFocus" Background="Azure" FontSize="16" Text="" />
                            <DatePicker Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="openorderDateChooser" VerticalAlignment="Top" Width="100" 
                                SelectedDateChanged="openorderDateChooser_SelectedDateChanged"/>
                        </WrapPanel>
                        <Expander ExpandDirection="Left" Header="关键说明" IsExpanded="False">
                            <FlowDocumentScrollViewer  Name="FlowDocViewer">
                                <FlowDocument> 
                                    <List>
                                        <ListItem>
                                            <Paragraph>
                                                <Run FontSize="12" FontWeight="Bold">
                                                    报表说明
                                                </Run>
                                                <LineBreak/>
                                                <Run FontSize="10">1.如果一个销售单关联多个后整理单，则显示多条记录。</Run>
                                                <LineBreak/>
                                                <Run FontSize="10">2.浆纱生产单中产生多个浆缸也将出现多条记录</Run>
                                                <LineBreak/> 
                                            </Paragraph>
                                        </ListItem> 
                                    </List>
                                </FlowDocument>
                            </FlowDocumentScrollViewer>
                        </Expander>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander Header="数据" Name="zoneDataList"  IsExpanded="True"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                              ItemsSource="{Binding Source={StaticResource aBPOSViewSource}}" 
                                              x:Name="MasterDg" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              HorizontalAlignment="Stretch"
                                              Height="400"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                    <DataGrid.Columns>
                        <!--订单号	ERP销售单号	类型	下单日期	品种	数量	单位	后整工艺	成品差距	销售回复	指定对缸号	浆纱颜色	完缸纬纱	ERP浆纱单号	ERP织造单号	后整单号	排单织缩率	排单后整缩率	缩率备注	排浆染日期	计划织厂	计划染厂	计划经长(M)	计划轴数	缸号	经长(M)	浆纱差(M)	出坯米数
                        织缩率	实际出坯数量	成品码数	
                        后整缩率	后整理填写日期	坯布留底	纬纱跟进打印日期	纬纱跟进打印日期	打印日期-->
                        <DataGridTextColumn Binding="{Binding Path=VKPWUTERM}"              Header="要求货期" Width="SizeToCells"  MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=REMAINDAYS}"             Header="余" Width="SizeToCells" MinWidth="20"/>
                        <DataGridTextColumn Binding="{Binding Path=KDKUNDNA}"                Header="客户" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}"              Header="回复时间" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=STATUS}"                        Header="最新动态" Width="SizeToCells" MinWidth="80"/>
                        <DataGridTextColumn Binding="{Binding Path=JSPLANDATE}"                Header="预计经纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=JSACTDATE}"                  Header="实际经纱" Width="SizeToCells"  MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VWPENDDATE}"             Header="预计浆纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VWAENDDATE}"             Header="实际到纱/通知接纱" Width="SizeToCells"  MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=YDPENDDATE}"              Header="预计染纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=YDAENDDATE}"             Header="实际染纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=WFPENDDATE}"             Header="预计纬纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=WFAENDDATE}"             Header="实际纬纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=GRPENDDATE}"              Header="预计完坯" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=GRAENDDATE}"              Header="实际完坯" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=FNPENDDATE}"              Header="预计后整" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=FNAENDDATE}"              Header="实际后整" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VKPAUFNUM}"               Header="订单号" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=VKPPOSTYP}"                 Header="类型" Width="SizeToCells" MinWidth="40"/>
                        <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}"                Header="下单日期" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=ARTICLE}"                       Header="品种" Width="SizeToCells" MinWidth="160"/>
                        <DataGridTextColumn Binding="{Binding Path=VKPMENGE1}"               Header="客单数量" Width="SizeToCells"  MinWidth="40"/>
                        <DataGridTextColumn Binding="{Binding Path=VKPRESERV}"               Header="预留计划" Width="SizeToCells"  MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=ABARESQTY}"             Header="后整单预留" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=VKPZUGET}"               Header="已留位" Width="SizeToCells"  MinWidth="40"/>
                        <DataGridTextColumn Binding="{Binding Path=VKPMEEH}"                    Header="单位" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=ABPBESCHICH}"             Header="后整理方式" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=FNVKDIFF}"                    Header="成品差距" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=SALESREPLAY}"             Header="销售回复" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=STDBATCHNO}"            Header="指定对缸号" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VWFARBE}"                   Header="浆纱颜色" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=WEFTYARNSTATUS}"    Header="完缸纬纱" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VWORDERNUM}"         Header="ERP浆纱单号" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=GWBORDER}"                Header="ERP织造单号" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=FORDERNUM}"             Header="ERP后整单号" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=PLANFNVWDIFF}"        Header="排单织缩率" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=VWPSTARTDATE}"       Header="排浆染日期" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=WPRODUCER}"            Header="计划织厂" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=SPRODUCER}"              Header="计划浆染厂" Width="SizeToCells"  MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=SBEAMLENG}"              Header="计划经长(M)" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=SBEAMNO}"                 Header="计划轴数" Width="SizeToCells" MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=SBEAMDATE}"          Header="实际回轴" Width="SizeToCells"  MinWidth="60"/>
                        <DataGridTextColumn Binding="{Binding Path=BMBEM}"                     Header="缸号" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=BEAMALENG}"             Header="经长(M)" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=VWDIFFAP}"                 Header="浆纱差(M)	" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=GREIGEPLANLENGTH}" Header="出坯米数" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=ACTWEAVEIN}"           Header="织缩率" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=GRALENG}"                 Header="实际出坯数量" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FPLANLENG}"             Header="成品计划码数" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FACTLENG}"                Header="成品实际码数" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FNGRSHRINK}"            Header="后整缩率" Width="SizeToCells" />
                    </DataGrid.Columns>
                </fd:FilteringDataGrid>
            </Expander>
        </StackPanel>
    </Grid>    
</local:DocumentBase>
